home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-04 | 2.0 KB | 88 lines | [TEXT/ALFA] |
- proc rebuildTclIndices {} {
- set dir [pwd]
- cd
- message "Building SystemCode index…"
- auto_mkindex :Tcl:SystemCode *.tcl
- message "Building UserCode index…"
- auto_mkindex :Tcl:UserCode *.tcl
- message ""
- cd $dir
- }
-
-
- proc tclMenuProc {menu item} {
- global tclColoring
-
- eval $item
- }
-
-
- #===========================================================================
- # Debug a Tcl procedure.
- #===========================================================================
-
- # Alpha TCL programming mode
-
- proc traceTclProc {} {
- global tclMenu
- if {[llength [traceFunc status]]>2} {
- markMenuItem $tclMenu {traceTclProc…} off
- enableMenuItem $tclMenu dumpTraces off
- dumpTraces [string trimright [lindex [traceFunc status] 3] {,}]
- setWinInfo dirty 0
- traceFunc off
- return
- }
- if {[llength [winNames]] && [string length [set sel [getSelect]]]} {
- set func [listpick -L $sel -p {Func Name:} [lsort -ignore [info procs]]]
- } else {
- set func [listpick -p {Func Name:} [lsort -ignore [info procs]]]
- }
- if {![string length $func]} return
- traceFunc on $func ""
- catch {markMenuItem $tclMenu {traceTclProc…} on}
- enableMenuItem $tclMenu dumpTraces on
- }
-
-
- proc dumpTraces {{name ""}} {
- if {![string length $name]} {
- set name [string trimright [lindex [traceFunc status] 3] {,}]
- }
- if {![string length [set res [traceDump]]]} {
- message "Trace buffer empty"
- } else {
- new -n "* Trace '$name' *"
- insertText $res
- setWinInfo dirty 0
- goto 0
- }
- }
-
- proc setTclMode {} {
- changeMode "Tcl"
- }
-
- #================================================================================
- proc TclMarkFile {} {
- set end [maxPos]
- set pos 0
- set l {}
- while {![catch {search -f 1 -r 1 -m 0 -i 0 {^proc} $pos} res]} {
- set start [lindex $res 0]
- set end [nextLineStart $start]
- set text [lindex [getText $start $end] 1]
- set pos $end
- set inds($text) [lineStart [expr $start - 1]]
- }
-
- if {[info exists inds]} {
- foreach f [lsort [array names inds]] {
- set next [nextLineStart $inds($f)]
- setNamedMark $f $inds($f) $next $next
- }
- }
- }
-
- proc dummyTcl {} {}
-